package com.prs.crm.service.approval.impl;

import java.util.List;

import com.prs.crm.dao.approval.ApplicationDao;
import com.prs.crm.domain.approval.Application;
import com.prs.crm.service.approval.ApplicationService;
import com.prs.crm.service.approval.ApproveService;
import com.prs.crm.service.impl.BaseServiceImpl;

public class ApplicationServiceImpl extends BaseServiceImpl<Application, ApplicationDao>
     implements ApplicationService{
	private ApproveService approveService;
	
	public ApproveService getApproveService() {
		return approveService;
	}

	public void setApproveService(ApproveService approveService) {
		this.approveService = approveService;
	}

	@Override
	public List<Application> getAllApp() {
		return this.getDao().getAllApp();
	}

	@Override
	public Application getApplicationById(Integer id) {
		// TODO Auto-generated method stub
		return this.getDao().getApplicationByid(id);
	}

//	@Override
//	public List<Application> getAllAppBysqType(Integer type) {
//		// TODO Auto-generated method stub
//		return this.getDao().getAllBysqType(type);
//	}

	@Override
	public void saveanddel(Application app) {
		this.save(app);
		this.approveService.removeApprove(app.getId());
		
	}
	@Override
	public Application getApplication(String appName) {
		// TODO Auto-generated method stub
		return this.getDao().getApplication(appName);
	}
	
}
